package com.xuecheng.media.agent;

import com.xuecheng.api.content.model.dto.TeachplanMediaDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.media.agent.impl.ContentApiAgentFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 *     媒资对内容管理Feign的远程调用
 * </p>
 *
 * @Description:
 */
@FeignClient(value = XcFeignServiceNameList.XC_CONTENT_SERVICE,fallback = ContentApiAgentFallBack.class)
public interface ContentApiAgent {

    /**
     * 根据媒资id查询课程计划和媒资绑定情况
     * @param mediaId - 媒资ID
     * @return - 课程计划和媒资绑定信息DTO
     */
    @GetMapping("/content/l/content/{mediaId}")
    RestResponse<TeachplanMediaDTO> getById(@PathVariable Long mediaId);

    @DeleteMapping("/content/l/content/{mediaId}")
    void removeById(@PathVariable Long mediaId);
}
